package com.aha.dataanalyzeandview.enums;

/******************************
 * Project:           data-analyze-and-view
 * FileName:          TrendEnum.java
 * ClassName:         TrendEnum
 * Time:              2020/8/17 23:10
 * Version:           1.00
 * Author:            努力就是魅力
 * Description:       TODO
 ******************************/
public enum  TrendEnum implements BaseEnum {

    /**
     * 趋势
     */
    UP(1, "上升"),
    HOLD(0, "保持不变"),
    DOWN(-1, "下降");



    private int code;
    private String value;

    TrendEnum(int code, String value) {
        this.code = code;
        this.value = value;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    public static TrendEnum valueOf(int code) {
        switch (code) {
            case -1:
                return TrendEnum.DOWN;
            case 0:
                return TrendEnum.HOLD;
            case 1:
                return TrendEnum.UP;
            default:
                return null;
        }
    }


}

